<?php

namespace app\api\model;

use think\Model;

class Banners extends Model
{
    protected $hidden = ['online', 'createtime', 'updatetime'];

    public function getImageAttr($value)
    {
        return $value ? request()->domain().$value : '';
    }

    public static function getBanners()
    {
        return self::where('online', 'yes')->order('weigh desc')->select();
    }
}
